//
//  RSMessageCreateManager.swift
//  ChatDemo
//
//  Created by 范强伟 on 2024/5/20.
//

import UIKit

enum MessageCmdType: Int{
    case Login = 0
    case HeartBeat = 1
    case PrivateChat = 3
    case GroupChat = 4
}

enum MessageContentType: Int{
    case Text = 0
    case Image = 1
    case Voice = 3
    case Video = 4
}

class RSMessageCreateManager: NSObject {

    class func createMessage(_ cmd:MessageCmdType,_ recvId: String = "",item: CLChatItem?) ->[String: Any]{
        var dic = [String: Any]()
        dic["cmd"] = cmd.rawValue
        
        var data = [String: Any]()
        data["userId"] = ""
        data["terminal"] = "1"
//        data["content"] = content
        data["recvId"] = recvId
         
        dic["data"] = data
        if let model = item{
            var content = [String: Any]()
            if let it = model as? CLChatImageItem {
                 
            }else if let it = model as? CLChatTextItem{
                content["text"] = it.text
                
            }else if let it = model as?  CLChatVoiceItem {
                
            }
        }
        return dic
    }
}
